#!/usr/bin/env python
# encoding: utf-8

"""
@author: wuyang
@software: PyCharm
@file: forms.py
@time: 2017/12/6 14:04
@文件描述：
"""

from django import forms
from django.contrib.auth import authenticate,login
from django.http import HttpResponseRedirect

import  logging
logger = logging.getLogger("myself")


# 定义了一个登录用的form
class LoginForm(forms.Form):
    username = forms.CharField(required=True,
                               error_messages={"required":"请输入账号"},
                               label="用户名",
                               widget=forms.TextInput(attrs={
                                   'class':'form-control',
                                   'placeholder':'用户名',
                                   'autofocus':True},
                                   ),
                               )
    password = forms.CharField(required=True,
                               error_messages={"required":"请输入密码"},
                               label="密码",
                               widget = forms.PasswordInput(attrs={
                                   'class':'form-control',
                                   'placeholder':"密码"}),
                               )


# 定义新增用户form
class UserAddForm(forms.Form):
    username = forms.CharField()
    email = forms.EmailInput()
    name = forms.CharField()
    phone = forms.CharField()
    qq = forms.CharField()







